package cn.easy.mortgage.bean;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class HjPGSearchHouseResultBean extends HjPGResultBaseBean {
    private List<String> list;

    public List<String> getList() {
        return list;
    }

    public void setList(List<String> list) {
        this.list = list;
    }

    public List<HjPGSingleQueryBean> getSingleQueryBeanList() {
        if (list == null) {
            return Collections.emptyList();
        }
        List<HjPGSingleQueryBean> result = new ArrayList<>();
        int i = 0;
        for (String str : list) {
            if (i++ % 2 == 1) {
                continue;
            }
            HjPGSingleQueryBean bean = new HjPGSingleQueryBean();
            String[] arr = str.split("[|]");
            bean.setHouseAddress(arr[0]);
            bean.setBuildingCode(arr[1]);
            bean.setCellNo(arr[2]);
            bean.setRoomNo(arr[3]);
            bean.setBegin(arr[4]);
            bean.setEnd(arr[5]);
            result.add(bean);
        }
        return result;
    }
}
